<%@ Page Language="vb" AutoEventWireup="false" Codebehind="CustomerOrders.aspx.vb" Inherits="MIMS_WRS.Web.CustomerOrders"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Customer Orders Information</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="bulkorderlist.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<LINK href="common.css" type="text/css" rel="stylesheet" name="Default stylesheet">
		<script language="JavaScript" src="../js/list.js"></script>
		<style type="text/css">
		#tblList1
			{		
				font-size: 0.9em;
				font-family: verdana, Arial, tahoma, sans-serif;	
				background-color: WhiteSmoke;
				width: 100%;
			}
			#tblList1 thead th
			{
				font-weight: bold;
				font-size: 11px;
				font-family: verdana, Arial, tahoma, sans-serif;
				color: #3A4F6C;
				background-color: #CFD9E7;
			}
			#tblList1 td
			{		
				white-space: nowrap;
				font-family: Verdana, Arial, Helvetica, sans-serif;
				font-size: 11px;
				cursor: pointer; 
				cursor: hand;
				border-top: 0px solid #CCC;
				border-left: 0px solid #CCC;		
			}

		#tblList
			{		
				font-size: 0.9em;
				font-family: verdana, Arial, tahoma, sans-serif;	
				table-layout: fixed;
				border-collapse: collapse;
				background-color: WhiteSmoke;
				width: 100%;
			}
			#tblList thead th, #tblList thead th.Locked
			{
				font-weight: bold;
				font-size: 11px;
				font-family: verdana, Arial, tahoma, sans-serif;
				color: #3A4F6C;
				background-color: #CFD9E7;
				/*white-space: nowrap;*/
				border-bottom: 0px solid #222;	
				text-align: center;	
				border-left: 0px solid #222;
				/*position:relative;		*/
			}
			#tblList td
			{		
				white-space: nowrap;
				font-family: Verdana, Arial, Helvetica, sans-serif;
				font-size: 11px;
				cursor: pointer; 
				cursor: hand;
				border-top: 0px solid #CCC;
				border-left: 0px solid #CCC;		
			}

			#tblList .tableRowHighlight
			{
				background-color: #00F;
				color: #FFF;	
			}

			#tblList .tableRowSelected
			{
				background-color: #9B9B1C;
				color: yellow;	
			}

			#tblList td.SelectedRowIndicated 
			{
				background-color: #ffffcc !important;
			}

			#tblList thead th {
			/*top: expression(document.getElementById("divOuter").scrollTop); /* IE5+ only */
			z-index: 20;
			}

			#tblList thead th.locked {z-index: 30;}

			#tblList td.locked,  th.locked{
			background-color: #ffeaff;
			font-weight: bold;
			border-right: 1px solid silver;
			/*left: expression(document.getElementById("divOuter").scrollLeft); /* IE5+ only */
			/*position: relative;*/
			z-index: 10;
			}		

	
			.CellWidth1 { WIDTH: 5% }
			.CellWidth2 { WIDTH: 10% }
			.CellWidth3 { WIDTH: 100px }
			.CellWidth4 { WIDTH: 100px }
			.CellWidth5 { WIDTH: 100px }
			.CellWidth6 { WIDTH: 160px }
			.CellWidth7 { WIDTH: 160px }
			.CellWidth8 {WIDTH: 80px}
			.CellWidth9 { WIDTH: 80px }
		</style>
		<script language="javascript">
			function openDetailDialog(shoppingOrderId,companyName) {
				var url = '../Offices/CustomerOrderDetails.aspx?id=' + shoppingOrderId + '&secondValue=' + escape(companyName);
				var title = escape('Order details');
				var height = 650;
				var width = 1100;
				var iTop = 20;
				var iLeft = 20;
				
				//window.showModalDialog('CustomerOrderDetails.aspx?title=' + title + '&id=' + shoppingOrderId + '&secondValue=' + company_Name, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; center: no; resizable: no; scroll: no; status: no;');
				window.showModalDialog('../Dialogs/ShowDialog.aspx?title=' + title + '&src=' + url, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; resizable: yes; scroll: yes; status: no;');
				
				return false;
			}
		</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="form1" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
			runat="server">
			<div id="actionTop">
				<div id="navigation"><A href="../StartPage.aspx">Front page</A>&nbsp;|&nbsp;<A href="../Login.aspx?logout=1">Log 
						out</A></div>
				<div id="title">
					<h5>
						Customer orders information
					</h5>
				</div>
				<div id="sort"></div>
				<div id="divOuter" style="float:left; ">
					<asp:DataList id="grdCustomerOrder" runat="server" Width="100%" RepeatColumns="1">
						<HeaderTemplate>
							<table id="tblList1" border="1"  cellpadding="0" cellspacing="0">
								<thead>
									<tr>
										<th style="text-align:left;width:3%">No</th>
										<th style="text-align:left;">Date</th>
										<th style="text-align:left;" colspan="8">Customer Information</th>
									</tr>
								</thead>
							<tbody>
						</HeaderTemplate>
						<ItemTemplate>
								<tr style="padding-top:15px" class="<%# GetRowClass(Container.DataItem) %>">
									<td ><asp:Literal id="ltrItemIndex" Runat="server"></asp:Literal></td>
									<td style="text-align:left;" valign="top">
										<asp:Label runat="server" id="lblGrade" >
											<%# GetDateText(DataBinder.Eval(Container.DataItem, "OrderDate"))%>
										</asp:Label>
										<br>	<br>	<br>
										 <span style="font-weight:bold;padding-top:10px">Con. Point:</span>
										<br>
										<%# DataBinder.Eval(Container.DataItem, "ContPointDescription") %>
									</td>
									<td colspan="8">
									<table style="width:100%" cellpadding="0" cellpadding="0" >
										<tr>
											<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>
										</tr>
										<tr>
											<td>
											<%# GetCustomerName(DataBinder.Eval(Container.DataItem, "Title"),DataBinder.Eval(Container.DataItem, "FamilyName"),DataBinder.Eval(Container.DataItem, "GivenName"))%>
											</td>
										</tr>
										<tr>
											<td><%# DataBinder.Eval(Container.DataItem, "StreetAddress") %></td>
										</tr>
										<tr>
											<td>
											<%# GetAddressInfo(DataBinder.Eval(Container.DataItem, "City"),DataBinder.Eval(Container.DataItem, "State"),DataBinder.Eval(Container.DataItem, "ZipCode"),DataBinder.Eval(Container.DataItem, "Country"))%>
											</td>
										</tr>
										<tr>
											<td><u>Email:</u> <%# DataBinder.Eval(Container.DataItem, "EmailAddress") %> &nbsp;&nbsp;&nbsp;<u>Phone number:</u> <%# DataBinder.Eval(Container.DataItem, "PhoneNumber") %></td>
										</tr>
									</table>
								</td>
								</tr>
								<tr>
									<td colspan="2">
										<asp:Label runat="server" id="Label3" Font-Bold="True" >Order Information: </asp:Label>
									</td>
									<asp:Panel runat="server"  ID="pnlFullOrder">
										<td  ><%# GetQty20Text(DataBinder.Eval(Container.DataItem, "Qty20"))%></td>
										<td ><%# GetQty40Text(DataBinder.Eval(Container.DataItem, "Qty40"))%></td>
										<td  ><%# GetQty40HCText(DataBinder.Eval(Container.DataItem, "Qty40HC"))%></td>
										<td width="280px">
											<asp:Label runat="server" id="Label6" > <strong>Total Volume:</strong> <%# GetTotalVolumeText(DataBinder.Eval(Container.DataItem, "Qty20"),DataBinder.Eval(Container.DataItem, "Qty40"),DataBinder.Eval(Container.DataItem, "Qty40HC"))%></asp:Label></td>
										<td   width="280px">
											<asp:Label runat="server" id="Label7" > <strong>Total Weight:</strong> <%# GetTotalWeightText(DataBinder.Eval(Container.DataItem, "Qty20"),DataBinder.Eval(Container.DataItem, "Qty40"),DataBinder.Eval(Container.DataItem, "Qty40HC"))%></asp:Label></td>
									</asp:Panel>
									<asp:Panel runat="server"  ID="pnlPartOrder">
										<td colspan="2">
											<asp:Label runat="server" id="Label8" > <strong>Existing production Order No:</strong> <%# DataBinder.Eval(Container.DataItem, "OrderNo")%></asp:Label></td>
										<td colspan="2">
											<asp:Label runat="server" id="Label9" > <strong>Half Pallet spaces: </strong> <%# GetHalfPalletSpacesText(DataBinder.Eval(Container.DataItem, "HalfPalletSpaces"))%></asp:Label></td>
										<td colspan="1">
											<asp:Label runat="server" id="Label2" > <strong>Filled volume: </strong><%# GetFilledVolumeText(DataBinder.Eval(Container.DataItem, "FilledVolume"))%></asp:Label></td>
									</asp:Panel>
									<td ><a  href="javascript:;"  onclick="openDetailDialog(<%# DataBinder.Eval(Container.DataItem, "ShoppingOrderId")%> , '<%# GetCompanyNameText(DataBinder.Eval(Container.DataItem, "CompanyName")) %>' )" >View Details</a></td>
									<td ><asp:LinkButton ID="lnkDelete" Runat="server" CommandName="Delete"   OnCommand="lnkDelete_Command" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ShoppingOrderId") %>' >Delete</asp:LinkButton></td>
									<td ><asp:LinkButton ID="lnkPrint" Runat="server" CommandName="Print"   OnCommand="lnkPrint_Command" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ShoppingOrderId") %>' >Print</asp:LinkButton></td>
								</tr>
						</ItemTemplate>
						<footertemplate>
						</tbody></table>
					</footertemplate>
					</asp:DataList>
				</div>
				<div style="TEXT-ALIGN: right;padding-top:10px"> 
					<asp:Button ID="btnPrint" Runat="server" Text="Print" width="75px" OnClick="btnPrint_OnClick"></asp:Button> &nbsp;&nbsp; <asp:Button ID="btnBack" Runat="server" Text="Back" width="75px"></asp:Button>
				</div>
			</div>
		</form>
	</body>
</HTML>
